<#import "/spring.ftl" as spring/>
<div class="row">
    <div class="col-lg-12">
        <div class="ibox float-e-margins">
          	<div class="filterItems">
				    <form class="form-inline" onsubmit="return false;">
				    	<div class="form-group">
					        <label for="supplierName">采购单号:</label>
					        <label id="supplierName" >${supplierName}</label>
					        <input type="hidden" class="supplierId" value=${supplierId}>
					      </div>
					    <div class="form-group">
					        <label for="supplierName">供应商名称:</label>
					        <label id="supplierName" >${supplierName}</label>
					        <input type="hidden" class="supplierId" value=${supplierId}>
					      </div>
				      <br><br>
				      
				      <label for="purchaseNo">仓库:</label>
				      <select class="form-control warehouseSelect">
				      <option value=-1>请选择仓库</option>
				      <#list warehouses as n>
			        		<option class="warehouse" value=${n.id}>${n.name}</option>
			          </#list>
				      </select>
				      
				       <label for="purchaseNo">结算方式:</label>
				        <select class="form-control payType">
					       <#list settlementMap?keys as key>
				        		<option class="warehouse" value=${key}>${settlementMap[key]}</option>
				          </#list>
					      </select>
				      
				      <div class="form-group">
				        <label for="reason">预付款:</label>
				        <input type="text" class="form-control round-border" id="reason" placeholder="">
				      </div>
				      
				      <div class="form-group">
				        <label for="reason">折扣额:</label>
				        <input type="text" class="form-control round-border" id="reason" placeholder="">
				      </div>
				      
				       <div class="form-group">
				        <label for="amount">采购总金额:</label>
				        <input type="text" class="form-control round-border" id="amount" placeholder="">
				      </div>
				      
				      
				      <br><br>
				      
				       <div class="form-group">
				        <label for="planDate">采购日期:</label>
				        <input type="text" class="form-control datepicker planDate">
				      </div>
				      
				      <div class="form-group">
				        <label for="actualDate">预估到货日期:</label>
				        <input type="text" class="form-control datepicker actualDate">
				      </div>
				      
				      
				      <div class="form-group">
				        <label for="address">送货地址:</label>
				        <input type="text" class="form-control round-border" id="address" placeholder="">
				      </div>
				      
				     <div class="form-group">
				        <label for="demo">备注:&nbsp;&nbsp;&nbsp;</label>
				        <input type="text" class="form-control round-border" id="demo" placeholder="">
				      </div>
				      <br><br>
				      <button type="" class="btn btn-info chooseRelative" >选择所有关联商品</button>
				      
				      <#--button type="" class="btn btn-default  clearTable">清空列表</button-->
				      
				      <button type="" class="btn btn-danger clearRelative ">不选择关联商品</button>
				      
				    </form>
          	</div>
           <br>
            <div class="ibox-content">
                <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline" role="grid">
                    <table id="supplierGoods" class=" table table-striped table-bordered table-hover dataTable" cellspacing="0" width="100%">
				        <thead>
				            <tr>
				                <th>货号</th>
				                <th>条码</th>
				                <th>商品名称</th>
				                <th>未到货数量</th>
				                <th>可用量</th>
				                <th>周均销量</th>
				                <th>销售价</th>
				                <th>最近采购价</th>
				                <th>采购价</th>
				                <th>折扣率(%)</th>
				                <th>税率</th>
				                <th>箱规</th>
				                <th>订购数量</th>
				                <th>金额小计</th>
				                <th>goodsId</th>
				                <th>goodsSpecId</th>
				            </tr>
				        </thead>
				    </table>
				    <button type="" class="btn btn-info addGoods pull-left" data-toggle="modal" data-target="#myModal">新增</button>
                    <button type="" class="btn btn-primary pull-right submitOrder">保存</button>
                </div>
               		 
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content" style="height:600px;width:850px;left:-110px;">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
               选择商品 | <label for="supplierName"> 供应商:</label>
		        <label id="supplierName" >${supplierName}</label>
            </h4>
         </div>
         <div class="modal-body">
             <div class="form-group">
		       
		      </div>
		      <form class="form-inline" onsubmit="return false;">
			      <div class="form-group">
			        <label for="address">货号:</label>
			        <input type="text" class="form-control round-border" id="taosku" placeholder="">
			      </div>
			      <div class="form-group">
			        <label for="address">条码:</label>
			        <input type="text" class="form-control round-border" id="bn" placeholder="">
			      </div>
			      <div class="form-group">
			        <label for="address">名称:</label>
			        <input type="text" class="form-control round-border" id="goodsName" placeholder="">
			      </div>
			      <button type="" class="btn btn-info searchPriceHistory" style="margin-left:20px">查询</button>
		      </form>
		      <br>
         	<div class="table-container">
                <table class="selectGoods table table-striped table-bordered table-hover dataTable">
				    <thead>
				            <tr>
				              <th><input type="checkbox" class="checkAll">选择</th>
				              <th>货号</th>
				              <th>条码</th>
				              <th>商品名称</th>
				              <th>在库成本价</th>
				              <th>采购价</th>
				              <th>采购日期</th>
				              <th>收货数量</th>
				            </tr>
				    </thead>
				    <tbody class="tbody">
				   </tbody>
			   </table>
			</div>
			<div class="modal-footer" style="text-align:center">
                <button type="button" class="btn btn-primary" id=" ">
                   选择
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                   关闭
                </button>
         </div>
			   <hr class="divider">
         </div>
         
      </div>
  </div>
</div>
<script src="<@spring.url '/assets/js/purchase/purchaseOrderDetail.js' />"></script>